/**
 * 封装轮播图组件
 * Author:碰磕
 */
 import React, { Component } from 'react';
 import Swiper, { Pagination,Navigation } from 'swiper';
 import 'swiper/css';
 Swiper.use([Navigation,Pagination]);
 class PengKeSwiper extends Component {
     componentDidMount(){
         new Swiper(".swiper",{
             pagination:{
                 el:'.swiper-pagination',
             },
             loop:this.props.loop
         })
         
     }
     render() {
         return (
             <div>
                 <div className="swiper" style={{height:"200px",background:"yellow"}}>
                     <div className="swiper-wrapper">
                         {
                             this.props.list.map(item=>
                             <div className="swiper-slide" key={item}>
                                <img src={item} width="100%" height="100%"></img>
                            </div>
                             )
                         }
                     </div>
                     <div className="swiper-pagination"></div>
                 </div>
             </div>
         );
     }
 }
 
 export default PengKeSwiper;